import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:myapp/app.dart';
import 'package:myapp/repositories/repositories.dart';
import 'package:myapp/simple_bloc_observer.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
// import 'login.dart';
// import 'signup.dart';
// import 'article.dart';
// import 'comment.dart';
// import 'article_edit.dart'; // Import the new article editing view



void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  Bloc.observer = SimpleBlocObserver();
  // ignore: missing_provider_scope
  runApp(
    MyApp(FirebaseUserRepo())
  );
}

// class MyApp extends StatelessWidget {
//   const MyApp({Key? key}) : super(key: key);

//   @override
//   Widget build(BuildContext context) {
//     return MaterialApp(
//       title: 'Flutter Demo',
//       theme: ThemeData(
//         primarySwatch: Colors.blue,
//         scaffoldBackgroundColor: Colors.transparent,
//         appBarTheme: AppBarTheme(
//           color: Colors.blue[800],
//           titleTextStyle: const TextStyle(
//             color: Colors.white,
//             fontSize: 20,
//             fontWeight: FontWeight.bold,
//           ),
//         ),
//         textTheme: const TextTheme(
//           bodyLarge: TextStyle(
//             color: Colors.white,
//             fontSize: 16,
//           ),
//         ),
//         inputDecorationTheme: InputDecorationTheme(
//           border: OutlineInputBorder(
//             borderRadius: BorderRadius.circular(10.0),
//           ),
//           filled: true,
//           fillColor: Colors.white.withOpacity(0.2),
//           hintStyle: const TextStyle(
//             color: Colors.white70,
//           ),
//         ),
//         elevatedButtonTheme: ElevatedButtonThemeData(
//           style: ElevatedButton.styleFrom(
//             backgroundColor: Colors.blue[900],
//             padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 16),
//             shape: RoundedRectangleBorder(
//               borderRadius: BorderRadius.circular(10.0),
//             ),
//             textStyle: const TextStyle(
//               fontSize: 18,
//               color: Colors.white,
//             ),
//           ),
//         ),
//         textButtonTheme: TextButtonThemeData(
//           style: TextButton.styleFrom(
//             foregroundColor: Colors.white,
//           ),
//         ),
//       ),
//       initialRoute: '/login',
//       routes: {
//         '/login': (context) => const LoginScreen(),
//         '/signup': (context) => const SignupScreen(),
//         '/article': (context) => const ArticleScreen(),
//         '/comment': (context) => const CommentScreen(),
//         '/article_edit': (context) => const ArticleEditScreen(), // Add the new route
//       },
//     );
//   }
// }
